$(function () {
    $('.input_sub').on('click', function () {
        // console.log($('login_form').serialize());

        $.ajax({
            type: 'post',
            url: 'http://localhost:8080/api/v1/admin/user/login',
            data: $('.login_form').serialize(),
            dataType: 'json',
            success: function (res) {
                $('#myModal').modal('show')
                $('#text').text(res.msg)
                if (res.code == 200) {
                    localStorage.setItem('bignew_token', res.token)
                    $('#myModal').on('hidden.bs.modal', function (e) {
                        window.location.href = './index.html'
                    })
                }
            }
        })
        $('#btns').on('click', function () {
            $('#myModal').modal('hide')
        })
    })
})